package com.syzygy.service.impl;

import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion;
import com.syzygy.mapper.UserMapper;
import com.syzygy.pojo.User;
import com.syzygy.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserByUserId(int userId) {
        return userMapper.getUserByUserId(userId);
    }

    @Override
    public int createUser(String username,
                          String password,
                          String nickname,
                          int phone,
                          String headSculptureId,
                          String headSculptureDocumentName,
                          String personalIntroduction
                          ) {
        return userMapper.createUser(username, password, nickname, phone, headSculptureId, headSculptureDocumentName,personalIntroduction);
    }

    @Override
    public User getUserByUserUsernameAndPassword(String username, String password) {
        return userMapper.getUserByUserUsernameAndPassword(username, password);
    }

    @Override
    public int editUser(String username, String password, String nickname, int phone, String headSculptureId, String headSculptureNewDocumentName, String personalIntroduction, int userId) {
        return userMapper.editUser(username,password,nickname,phone,headSculptureId,headSculptureNewDocumentName,personalIntroduction,userId);
    }
}
